@model IEnumerable<MVCCornucopia.Data.Employee>


@*    ------- This is purely for intellisense support in VS 2010  -------------------*@
@if (false)
{
    <script type="text/javascript" src="~/Scripts/jquery-1.7.1-vsdoc.js"></script>
    <script type="text/javascript" src="~/Scripts/jquery.validate-vsdoc.js"></script>
}

<table>
    <tr>
        <th width="200">&nbsp;
        </th>
        <th>
            Domain
        </th>
        <th>
            Occupation
        </th>
        <th>
            Gender
        </th>
        <th>
            First Name
        </th>
        <th>
            Last Name
        </th>
        <th>
            Date Of Birth
        </th>
        <th>
            Background Color
        </th>
        <th>
            Email Address
        </th>
        <th>
            Phone Number
        </th>
        <th>
            Facebook Url
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td width="200">
                @Ajax.ActionLink("Edit", "EditAjax", new { id = item.EmployeeId }, new AjaxOptions
                   {
                       UpdateTargetId = "editDialog",
                       HttpMethod = "GET",
                       InsertionMode = InsertionMode.Replace,
                       OnComplete = "OpenEditDialog",
                       LoadingElementId = "resultLoadingDiv"
                   }) |
                @Ajax.ActionLink("Details", "DetailsAjax", new { id = item.EmployeeId }, new AjaxOptions
                   {
                       UpdateTargetId = "editDialog",
                       HttpMethod = "GET",
                       InsertionMode = InsertionMode.Replace,
                       OnComplete = "OpenEditDialog",
                       LoadingElementId = "resultLoadingDiv"
                   }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.EmployeeId }, new { @class = "delete-link" })

            </td>
            <td>
                @item.DomainUserName
            </td>
            <td>
               @Html.DisplayFor(x => item.EmployeeOccupationId, "EmployeeOccupation")
            </td>
            <td>
                @Html.DisplayFor(x => item.GenderId, "Gender")
            </td>
            <td>
                @item.FirstName
            </td>
            <td>
                @item.LastName
            </td>
            <td>
                @String.Format("{0:g}", item.DateOfBirth)
            </td>
            <td>
                @Html.DisplayFor(x => @item.ThemeBackgroundColor, "Color")
            </td>
            <td>
                @item.EmailAddress
            </td>
            <td>
                @item.PhoneNumber
            </td>
            <td>
                @item.FacebookUrl
            </td>
        </tr>
    }
</table>

<div id="delete-dialog" style="display: none">
    Are you sure you want to delete this record?
</div>


